package com.smxy.mall.controller;

import com.smxy.mall.common.Response;
import com.smxy.mall.model.request.VipReq;
import com.smxy.mall.service.VipService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/vip")
@Api(tags = "会员模块")
public class VipController {

    @Resource
    private VipService vipService;

    @ApiOperation("新增编辑等级")
    @PostMapping("/save")
    public Object add(VipReq vipReq){
        return Response.success(vipService.save(vipReq));
    }

    @ApiOperation("会员等级列表")
    @GetMapping("/list")
    public Object list(){
        return Response.success(vipService.list());
    }
}
